package com.cv.framework.email.config;

import com.cv.framework.email.core.service.CvEmailService;
import com.cv.framework.email.core.service.CvEmailServiceImpl;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;

/**
 * 邮件自动配置类
 *
 * @author Charles_XDXD
 */
@AutoConfiguration
@EnableConfigurationProperties(CvEmailProperties.class)
public class CvEmailAutoConfiguration {

    @Resource
    private CvEmailProperties cvEmailProperties;

    @Bean
    public CvEmailService cvEmailService() {
        return new CvEmailServiceImpl(cvEmailProperties);
    }

}
